﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Rison.Web.Common;
using Rison.BusinessFacade.Helper;
using Rison.BusinessFacade.Common;
using Rison.BusinessFacade.Entity.ZP;
using Rison.BusinessFacade.Facade.ZP;
using Rison.DataAccess.Common;

namespace Rison.Web.ZP
{
    public partial class Yxsb : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindDate();
            }
        }

        private void BindDate()
        {
            if (departid != "")
            {
                YxsbFacade facade = new YxsbFacade();
                DataSet ds = facade.GetYxsbList(departid, year);

                this.Repeater1.DataSource = DataSouce(ds.Tables[0], "新闻特色专题");
                this.Repeater1.DataBind();

                this.Repeater2.DataSource = DataSouce(ds.Tables[0], "政府审批事项");
                this.Repeater2.DataBind();

                this.Repeater3.DataSource = DataSouce(ds.Tables[0], "政府服务事项上网比例");
                this.Repeater3.DataBind();

                this.Repeater4.DataSource = DataSouce(ds.Tables[0], "涉外服务事项");
                this.Repeater4.DataBind();

                this.Repeater5.DataSource = DataSouce(ds.Tables[0], "热点互动项目");
                this.Repeater5.DataBind();

                this.Repeater6.DataSource = DataSouce(ds.Tables[0], "网站综合管理");
                this.Repeater6.DataBind();
            }

         }

        private DataView DataSouce(DataTable dt ,string anlx)
        {
            DataView dv =new DataView(dt);

            dv.RowFilter="anlx='" + anlx + "'";

            return dv;
        }

        protected string departid
        {
            get { return string.IsNullOrEmpty(Request.QueryString["DepartID"]) ? "" : Request.QueryString["DepartID"]; }
        }

        private string year
        {
            get { return string.IsNullOrEmpty(Request.QueryString["year"]) ? System.DateTime.Today.Year.ToString() : Request.QueryString["year"]; }
        }
    }
}
